<template>
  <div class="film-search">
    <h2>搜索结果</h2>
    <div v-if="searchResults.length > 0">
      <el-table :data="searchResults" style="width: 100%">
        <el-table-column prop="title" label="电影名称"></el-table-column>
        <el-table-column prop="rating" label="评分"></el-table-column>
      </el-table>
    </div>
    <div v-else>未搜索到相关电影</div>
  </div>
</template>

<script>
export default {
  name: 'FilmSearch',
  data() {
    return {
      searchResults: []
    };
  },
  created() {
    // 直接传递当前路由的查询参数
    this.$router.push({
      name: 'FilmCategory',
      query: this.$route.query
    });
  }
};
</script>

<style scoped>
.film-search {
  color: white;
  padding: 20px;
}
</style>